fun main(args: Array<String>) {

    val items = listOf("apple", "banana", "wiki")
    //对集合进行迭代
    for (item in items) {
        println(item)
    }

    //使用in运算符判断集合内是否包含某实例
    val sets = setOf("apple", "banana", "wiki")
    when {
        "orange" in sets -> println("juicy")
        "apple" in sets -> println("apple is fine too")
    }

    //使用lambda表达式过滤（filter）和映射（map）集合
    val fruits = listOf("banana", "avocado", "apple", "kiwi")
    fruits
        .filter { it.startsWith("a") }
        .sortedBy { it }
        .map { it.toUpperCase() }
        .forEach { println(it) }
}



